qt_add_plugin(${taskbuttons_plugin_name}
    CLASS_NAME TaskButtons
    taskbuttons.cpp taskbuttons.h
)

set_target_properties(${taskbuttons_plugin_name} PROPERTIES
    LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/src/plugins/janna.${taskbuttons_plugin_name}-${PROJECT_VERSION}"
)

target_link_libraries(${taskbuttons_plugin_name} PRIVATE
    ${util_lib_name}
    ${pubsub_lib_name}
    Qt${QT_VERSION_MAJOR}::Core
    Qt${QT_VERSION_MAJOR}::Gui
    Qt${QT_VERSION_MAJOR}::Widgets
)

# 构建后动作
add_custom_command(TARGET ${taskbuttons_plugin_name} POST_BUILD

    # 复制插件配置文件
    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${taskbuttons_plugin_name}.json ${PROJECT_BINARY_DIR}/src/plugins/janna.${taskbuttons_plugin_name}-${PROJECT_VERSION}/${taskbuttons_plugin_name}.json
)


